package com.lzx.tease.controller.web;

import com.lzx.common.utils.R;
import com.lzx.tease.entity.Comments;
import com.lzx.tease.service.CommentsService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author 程序员星星
 * @date 2022/12/20
 * @Description
 */
@RestController
@RequestMapping("/tease/comments/web")
public class WebCommentsController {
    @Resource
    private CommentsService commentsService;

    //获取所有评论
    @GetMapping("/getCommentsList")
    public R getCommentsList() {
        return commentsService.getCommentsList();
    }

    //用户发表评论
    @PostMapping("/saveComments")
    public R saveComments(@RequestBody Comments comments) {
        return commentsService.saveComments(comments);
    }
}
